const Mock = require('mockjs'); // 假数据

module.exports = function (app) {
    const prefix = '/wap/my/';
    const baseinfo = Mock.mock({
        'result': {
            'userPhoto': null,
            'userName': '@name()',
            'postName': ['前端开发工程师(研发一部)'],
            'jobNum': 'NJ015070043',
            'sex': 1,
            'userPicture': '/file/photo/13/13_picture.jpg',
            'email': 'liuyunpeng@52yunxi.cn',
            'qq': '12345678',
            'tel': '138****1449',
            'department': [{'id': 101, 'name': '总公司-技术中心-研发一部'}]
        }
    });
    // API::权限列表
    app.get(prefix + 'base_info', (req, res) => {
        const code = 200;
        const msg = '';
        const data = baseinfo;
        const time = +(new Date);
        const result = {code, data, msg, time};
        return res.end(JSON.stringify(result));
    });
};
